/**南航明珠商城-评论审核列表.js*/

 function search(){
        $("#page").val("1");
        $("#query_compaints_prosals_form").submit();
	 }	
function toIsEmpty(){
    document.getElementsByName("productId")[0].value= "";
    document.getElementsByName("state")[0].value= "";
    $("#startDate").val("");
    $("#endDate").val("");
}

//通过审核
function checkOk(){
	var ids="";
	$("[name=ids]:checked").each(function(){
		var id=$(this).val();
		ids+=id+",";
	})
	if(ids.length==0){
		layer.alert("请选择要审核的数据！");
		return false;
	}
	layer.confirm("确定批量通过审核?",function(){
		layer.closeAll('dialog');
		var layer_load_window = layer.load(2); 
	var url=path+"/compaints_proposals/update_by_id?id="+ids+"&state=2"
	$.ajax({
		url : url,
		cache : false,
		type : 'post',
		dataType : 'text',
		error : function() {
			layer.alert("操作失败！");
         },
		success : function(data) {
		   if(data == "200"){
			layer.alert("审核成功！",function(){
			   $("#query_compaints_prosals_form").submit();
			});
		   }else{
			layer.alert("操作失败！");
		   }
		},complete: function(XMLHttpRequest, textStatus) {
			layer.close(layer_load_window);
		}
	  })		
	});
}